#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "include/filesContent.h"

/** 
  Function Name     : getOkHeader 
  Input Paramaters  : xmlLength
  Output Paramaters : char pointer 
  Result            : head
  Description       : create xml file head
*/

char* getOkHeader(char* xmlLength)
{
 memset(headerResult,0,80);
 sprintf(headerResult,"HTTP/1.1 200 OK\nContent-Type:text/xml;charset=\"utf-8\"\nContent-Length:%i\n\n",strlen(xmlLength));
 return (char*)headerResult; 
}

/**
  Function Name     : concatHeadAndXml 
  Input Paramaters  : char pointers head && xml file
  Output Paramaters : char pointer head
  Result            : head
  Description       : concat head and xml file
*/
char* concatHeadAndXml(char* head,char* xmlFile)
{
  strcat(head,xmlFile);
  return head;
}
/**
  Function Name     : getInformResponse 
  Input Paramaters  : char pointers inforResponse
  Output Paramaters : char pointer retInforResponse
  Result            : head
  Description       : insert value in get inform responde xml
 */
char* getInformResponse( char* inforResponse )
{
  sprintf(retInforResponse,inforResponse,1,1);
  return (char*)retInforResponse;
}
/** 
  Function Name     : getParameterName 
  Input Paramaters  : char pointers paramName
  Output Paramaters : char pointer retParamName
  Result            : retParamName
  Description       : insert value in get parameter name xml
 */
char* getParameterName( char* paramName )
{
  sprintf(retParamName,paramName,1,0);
  return (char*)retParamName;
}

// char* get_fw_download_xml( char* fw_xml,char* url,char* username,char* passw )
// {
//   memset(fw_finish_xml,0,sizeof(fw_finish_xml));
//   sprintf(fw_finish_xml,fw_xml,url,username,passw);
//   return (char*)fw_finish_xml;
// }




